﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 战棋模拟器
{
    class 洞穴多头蛇:Minion
    {
        public 洞穴多头蛇():base()
        {
            Star = 4;
            Attack = 2;
            Health = 4;
            Race = race.beast;
        }


        public override void Doattack(Minion m)
        {
            Minion left = null, right = null;
            if (m.Place > 0)
            {
                left = m.pool.places[m.Place - 1];
            }
            if (m.Place < m.pool.minionCount - 1)
            {
                right = m.pool.places[m.Place + 1];
            }
            if(pool.board.Debug)
            {
                Console.WriteLine("对{0}{1}{2}分别造成了{3}点伤害",
                    left != null ? left.Name + "," : "",
                    m.Name,
                    right != null ? "," + right.Name : "",
                    Attack);
            }
            if (m.Attack > 0)
            {
                if (Skills[3])
                    ShieldLost();
                else
                    Getdamaged(m.Attack);
                if (m.Skills[0])
                    pool.board.deadQ.Enqueue(this);
                if (pool.board.deadQ.Contains(this) && (m.Race == race.dragon || m.Race == race.all))
                    m.pool.OnDragonKill();
            }

            //调用Aoe
            var victims = new List<Minion>() {left,m,right};
            m.pool.board.Aoe(Attack, victims);
        }


        public override Minion NewOne()
        {
            return new 洞穴多头蛇();
        }
    }


    class 洞穴多头蛇_金色 : 洞穴多头蛇
    {
        public 洞穴多头蛇_金色() : base()
        {
            Attack *= 2;
            Health *= 2;
            count *= 2;
            buff *= 2;
        }

        public override Minion NewOne()
        {
            return new 洞穴多头蛇_金色();
        }
    }
}
